/**
 * Created by Administrator on 2016/9/4 0004.
 * 处理evaluateWork.jsp中的事物处理
 */
var contextPath = "/";
$(function () {
    contextPath += window.location.pathname.split("/")[1];
    $("#toptitle").html("评价作业");
    //提交评价
    $("#sub").click(function () {
        var url = contextPath+"/teacherWorkController/evaluate.wm";
        var data = {};
        data.workId = $("#eWorkid").val();
        var evatext = $("#evalInfo").val();
        data.evatext = evatext;
       console.log(evatext);
        $.post(url,data,function (result) {
            if(result.msg == "true"){
                alert("提交评价成功！");
            } else {
                alert("提交评价失败！");
            }
        },"json");
    });
    //取消评价，即清空评价textarea中的内容
    $("#cancel").click(function () {
        var id = $("#jobTaskId").val();
        location.href=contextPath+'/teacherWorkController/workDetail.wm?id='+id;
    });
})